import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 * User: zm
 * Date: 2023/4/2
 */
public class Demo10 {
    public static boolean Year(String s){
        int temp = Integer.valueOf(s.substring(6,8));
        System.out.println(temp);
        if(temp % 4 == 0){
            return true;
        }else{
            return false;
        }
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];
        int max = 0;
        for (int i = 0; i < n; i++) {
            array[i] = scan.nextInt();
            if(array[i] > max){
                max = array[i];
            }
        }
        System.out.println(max);

    }
}
